<!--编辑设备供应-->
<template>
    <div>
        <el-row>
            <el-col :span="18">
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <!--主营设备-->
                    <el-form :inline="true" :model="form" class="demo-form-inline">
                        <el-form-item label="主营设备" >
                            <span v-for="item in form.deviceList " style="margin:10px">{{item}}</span>
                        </el-form-item>
                        <el-button type="info" @click="openDialog('addShebei')" style="margin-bottom:20px">设置主营设备</el-button>
                    </el-form>
                    <!--企业知名度-->
                    <el-form-item label="企业知名度">
                        <!--<el-select v-model="form.companypopularityId" placeholder="请选择">-->
                            <!--<el-option label="区域一" value="shanghai" v-for="item in companypopularityList"></el-option>-->
                        <!--</el-select>-->
                        <el-select v-model="form.popularity">
                            <el-option label="一级" value="0" ></el-option>
                            <el-option label="二级" value="1" ></el-option>
                            <el-option label="三级" value="2" ></el-option>
                            <el-option label="四级" value="3" ></el-option>
                            <el-option label="五级" value="4" ></el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
                <!--售后网络覆盖区域-->
                <el-form :inline="true" :model="form" class="demo-form-inline">
                    <el-form-item label="售后网络覆盖区域">
                        <span v-for="item in form.provinceOptions" style="margin:10px">{{item}}</span>
                    </el-form-item>
                    <el-button type="info" @click="openDialog('addArea')" style="margin-bottom:20px">设置区域</el-button>
                </el-form>
                <!--市场占有率-->
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <el-form-item label="市场占有率">
                        <el-input v-model="formInline.user" placeholder="市场占有率"></el-input>
                    </el-form-item>
                    <span style="font-size: 25px">%</span>
                </el-form>
                <!--销售方式-->
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <el-form-item label="特殊能力">
                        <template>
                            <el-checkbox-group v-model="checkList">
                                <el-checkbox label="直销"></el-checkbox>
                                <el-checkbox label="代理"></el-checkbox>
                                <el-checkbox label="EPC"></el-checkbox>
                                <el-checkbox label="其他"></el-checkbox>
                            </el-checkbox-group>
                        </template>
                    </el-form-item>
                </el-form>
                <!--添加关键人物-->
                <h3>关键人物</h3>
                <el-form :inline="true" :model="formInline" class="demo-form-inline" v-for="(item,index) in keyManmessage" style="padding-left: 80px">
                    <el-form-item >
                        <el-select v-model="entrepot[index].name" placeholder="请选择">
                            <el-option
                                    v-for="data in item.man"
                                    :label="data.label"
                                    :value="data.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="职务">
                        <el-select v-model="entrepot[index].status" placeholder="请选择">
                            <el-option
                                    v-for="data in item.man"
                                    :key="data.value"
                                    :label="data.label"
                                    :value="data.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-button type="text" @click="delMan(index)">移除</el-button>
                </el-form>
                <el-button type="info" @click="addMan" style="margin-left: 80px">添加人物</el-button>
            </el-col>
            <el-col :span="1">
                <hr style="height:200px;width: 1px">
            </el-col>
            <el-col :span="5"><div >
                <h2>评价星级</h2>
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <el-form-item>
                        <el-select v-model="formInline.star" placeholder="评价星级">
                            <el-option label="一星" value="shanghai"></el-option>
                            <el-option label="二星" value="beijing"></el-option>
                            <el-option label="三星" value="tar"></el-option>
                            <el-option label="四星" value="shang"></el-option>
                            <el-option label="五星" value="shanhai"></el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
            </div></el-col>
        </el-row>
        <!--设备供应-->
        <el-dialog title="设备供应选项" :visible.sync="dialog.addShebei.open" v-if="dialog.addShebei.open" :modal="false" top="65%" size="small">
            <template>
                <!--设备选项-->
                <el-checkbox-group v-model="form.checkList">
                    <el-checkbox :label="option" v-for="option in deviceOptions" style="margin: 10px"></el-checkbox>
                </el-checkbox-group>
                <el-button type="primary" size="small" @click="commit('addShebei')">确定</el-button>
            </template>
        </el-dialog>
        <!--省份选项-->
        <el-dialog title="售后网络覆盖区域" :visible.sync="dialog.addArea.open" v-if="dialog.addArea.open" :modal="false" top="65%" size="small">
            <template>
                <el-checkbox-group v-model="form.provinceList">
                    <el-checkbox :label="option" v-for="option in areaOptions" style="margin: 10px"></el-checkbox>
                </el-checkbox-group>
                <el-button type="primary" size="small" @click=" addProvince('addArea')">确定</el-button>
            </template>
        </el-dialog>
    </div>
</template>
<script>
    import _http from '@/components/common/http.vue'
    import _param from '@/components/common/param.vue'
    export default {
        data() {
            return {
                apiPort:{
//                    企业知名度
                    companypopularityApi:'',
//
                },
                form:{
                    provinceOptions:[],
                    provinceList:[],
                    deviceList:[],
                    checkList: [],
//                    企业知名度列表
                    companypopularityList:'',
                    popularity:''

                },
                //                关键人物信息存储
                entrepot:[{name:'',status:''}],
                keyManmessage:[{
                    man:[
                        {
                            value: '选项4',
                            label: '龙须面'
                        }, {
                            value: '选项5',
                            label: '北京烤鸭'
                        }
                    ],
                    duty:[
                        {
                            value: '选项4',
                            label: '龙须面'
                        },
                        {
                            value: '选项5',
                            label: '北京烤鸭'
                        }
                    ]}
                ],
//                里面放省份
                areaOptions:["北京市","安徽省","福建省","甘肃省","广东省","广西壮族自治区","贵州省","海南省","河北省","河南省","黑龙江省","湖北省","湖南省","吉林省","江苏省","江西省","辽宁省","内蒙古自治区","宁夏回族自治区","青海省","山东省","山西省","陕西省","上海市","四川省","天津市","西藏自治区","新疆维吾尔自治区","云南省","浙江省","重庆市","香港特别行政区","澳门特别行政区","台湾省",],
                deviceOptions:['LMBR一体化污水处理设备','空气源热泵热水机组','水控机','水泵燃气发电机组','冷水机组','地源热泵机组','溴化锂空调机组','余热锅炉','生物质锅炉','燃气锅炉','热交换设备','水泵','蓄冰槽(桶)','蓄热罐','光伏太阳能组件和逆变器','汽轮机','冷却塔','餐厨垃圾破碎设备','秸秆破碎设备','厌氧消化器','沼气发电机组','沼气锅炉','火炬','油脂加工设备','固液分离设备','沼气提纯装置','沼气储气柜','沼气净化装置','自控设备','垃圾焚烧炉','破碎机','太阳能低温蒸发干化系统','碳化炉及辅助加热系统','冷热源设备','空气处理设备','通风设备','空调水系统设备','风系统及水系统调节控制设备','灯具','照明控制系统','保温材料','节能门窗','其他建材','节水器具','锅炉','汽轮机','太阳能电池组件','蓄电池','控制器','逆变器','其他相关设备'],
                dialog:{
                    addShebei:{
                        open:false
                    },
                    addArea:{
                        open:false
                    }
                },
                checkList:[],
                information:{
                    classes:'综合',
                    issued:'住建部',
                    grade:'甲级',
                    charge:'100000元每案',
                    professField:'土地规划，环保设计',
                    keyMan1:'俞兆洪-总裁/CEO-18058715658',
                    keyMan2:'吴高翔-销售-18058715658'
                },
                formInline: {
                    user: '',
                    region: '',
                    star:''
                }
            }
        },
        methods:{
            getType(){
                var that = this
//            企业知名度
                _http.axiosGet(that,that.apiPort.aptitudeApi,(res)=>{
                    that.form.companypopularityList=res.L0
            })
            },
            addMan(){
                this.entrepot.push(
                        {name:'',status:''}
                )
                this.keyManmessage.push(
                        {
                            man:[
                                {
                                    value: '选项4',
                                    label: '龙须面'
                                }, {
                                    value: '选项5',
                                    label: '北京烤鸭'
                                }
                            ],
                            duty:[
                                {
                                    value: '选项4',
                                    label: '龙须面'
                                },
                                {
                                    value: '选项5',
                                    label: '北京烤鸭'
                                }
                            ]}
                )
            },
            commit(addField){
                this.form.deviceList=this.form.checkList
                this.dialog[addField].open = false
            },
            addProvince(addField){
                this.form.provinceOptions=this.form.provinceList
                this.dialog[addField].open = false
            },
            delMan(index){
                this.entrepot.splice(index,1)
                this.keyManmessage.splice(index,1)
            },
            openDialog(dialog){

                this.dialog[dialog].open = true
            }
        }
    }
</script>